<template>
	<view class="pb30">
		
		
		<view class="whiteBg mb10">
			<switchTabber :list="['站点基本信息','运行维护记录','停产停运记录']" :index="curIndex" @change="changeMenu"></switchTabber>
		</view>
		
		<block v-if="!isHide">
			
			<station-info v-if="curIndex == 0" ref="stationInfo" :sid="id"></station-info>
			
			<run-records key="a" v-if="curIndex == 1" ref="runRecords" :sid="id" :realType="1"></run-records>
			
			<run-records key="b" v-if="curIndex == 2" ref="stopRecords" :sid="id" :realType="2"></run-records>
			
		</block>
		
		
		
		
		<!-- 废气 -->
		<!-- <block v-if="type == 2"> 
		
			<block v-if="curIndex == 1">
				<navigator hover-class="op9" :url="`/pages/addStation/addStation1?sid=${id}`" class="pl15 whiteBg">
					<view class=" ptb10 bt">
						<arrowNav>
							  废气排放口基本情况
						</arrowNav>
					</view>
				</navigator>
				<navigator hover-class="op9" :url="`/pages/quipment/quipmentList2?id=${id}`" class="pl15 whiteBg">
					<view class=" ptb10 bt">
						<arrowNav>
							 废气排放口自动监测设备基本情况	
						</arrowNav>
					</view>
				</navigator>
				<navigator hover-class="op9" :url="`/pages/waterCollector/waterCollectorSave2?stationId=${id}`" class="pl15 whiteBg">
					<view class=" ptb10 bt">
						<arrowNav>
							 废气数采仪基本情况
						</arrowNav>
					</view>
				</navigator>
				<navigator hover-class="op9" :url="`/pages/monitoringFacilities/monitoringFacilitiesSave2?stationId=${id}`" class="pl15 whiteBg">
					<view class=" ptb10 bt">
						<arrowNav>
							  监控设施基本情况
						</arrowNav>
					</view>
				</navigator>
			</block>
			
			
			<block v-if="curIndex == 0">
				
				<gasInfo ref="gasInfo" :stationId="id" :type="type"></gasInfo>
				
			</block>
			
			<block v-if="curIndex == 2">
				
				<navigator hover-class="op9" :url="`/pages/daliyRecordMenu/daliyRecordMenu?id=${id}`" class="pl15 whiteBg  bt ">
					<view class=" ptb10 ">
						<arrowNav>
							CEMS日常巡检维护记录
						</arrowNav>
					</view>
				</navigator>
				
				<navigator hover-class="op9" :url="`/pages/calibrationList/calibrationList?id=${id}`" class="pl15 whiteBg   ">
					<view class=" ptb10 bt">
						<arrowNav>
							CEMS零点/量程漂移与校准记录
						</arrowNav>
					</view>
				</navigator>
				
				
				<navigator class="pl15 whiteBg mb10 bb" hover-class="op9" :url="`/pages/compareCheckList/compareCheckList?id=${id}&type=${type}`">
					<view class="bt ptb10">
						<arrowNav>
							CEMS比对校验记录
						</arrowNav>
					</view>
				</navigator>
				
				<navigator class="pl15 whiteBg" hover-class="op9" :url="`/pages/repaire/repaireList?id=${id}`">
					<view class="bt ptb10">
						<arrowNav>
							故障维修记录
						</arrowNav>
					</view>
				</navigator>
				
				<navigator class="pl15 whiteBg" hover-class="op9" :url="`/pages/gasReplace/gasReplaceList?id=${id}`">
					<view class="bt ptb10">
						<arrowNav>
							标准气体更换记录
						</arrowNav>
					</view>
				</navigator>
				
				
				<navigator hover-class="op9" :url="`/pages/comsumablesRepalce/comsumablesRepalceList?id=${id}&type=${type}`" class="pl15 whiteBg  bb mb10">
					<view class=" ptb10 bt">
						<arrowNav>
							易耗品更换记录
						</arrowNav>
					</view>
				</navigator>
				
				
				
				
				
			</block>
			
		</block> -->
		<!-- <block v-else>
			
			<block v-if="curIndex == 1">
				
				<navigator hover-class="op9" :url="`/pages/addStation/addStation0?sid=${id}`" class="pl15 whiteBg">
					<view class=" ptb10 bt">
						<arrowNav>
							 废水排放口基本情况								
						</arrowNav>
					</view>
				</navigator>
				
				<navigator hover-class="op9" :url="`/pages/quipment/quipmentList?id=${id}`" class="pl15 whiteBg">
					<view class=" ptb10 bt">
						<arrowNav>
							废水排放口自动监测设备
						</arrowNav>
					</view>
				</navigator>
				
				<navigator hover-class="op9" :url="`/pages/waterCollector/waterCollectorSave?stationId=${id}`" class="pl15 whiteBg">
					<view class=" ptb10 bt">
						<arrowNav>
							 废水数采仪基本情况
						</arrowNav>
					</view>
				</navigator>
				
				<navigator hover-class="op9" :url="`/pages/monitoringFacilities/monitoringFacilitiesSave?stationId=${id}`" class="pl15 whiteBg">
					<view class=" ptb10 bt">
						<arrowNav>
							  监控设施基本情况
						</arrowNav>
					</view>
				</navigator>
				
			</block>
			
			
			<block v-if="curIndex == 0">
				
				<watersInfo ref="watersInfo" :stationId="id" :type="type"></watersInfo>
				
			</block>
			
			<block v-if="curIndex == 2">
				
				<navigator hover-class="op9" :url="`/pages/daliyRecordMenu/daliyRecordMenu?id=${id}`" class="pl15 whiteBg ">
					<view class=" ptb10 bt">
						<arrowNav>
							巡检维护记录
						</arrowNav>
					</view>
				</navigator>
				
				
				<navigator hover-class="op9" :url="`/pages/sampleRecord/sampleRecordList?id=${id}`" class="pl15 whiteBg   ">
					<view class=" ptb10 bt">
						<arrowNav>
							标样核查及校准记录
						</arrowNav>
					</view>
				</navigator>
				
				<navigator hover-class="op9" :url="`/pages/compareCheckList/compareCheckList?id=${id}&type=${type}`" class="pl15 whiteBg  bb mb10">
					<view class=" ptb10 bt">
						<arrowNav>
							实际水样比对试验记录
						</arrowNav>
					</view>
				</navigator>
				
				<navigator class="" hover-class="op9" :url="`/pages/repaire/repaireList?id=${id}`">
					<arrowNav>
						<view class="whiteBg ptb10 pl15">
							故障维修记录			
						</view>
					</arrowNav>
				</navigator>
				
				<navigator hover-class="op9" :url="`/pages/reagentRenewal/reagentRenewalList?id=${id}`" class="pl15 whiteBg ">
					<view class=" ptb10 bt">
						<arrowNav>
							试剂与标样更换记录
						</arrowNav>
					</view>
				</navigator>
				
				<navigator hover-class="op9" :url="`/pages/liquidRecycle/liquidRecycleList?id=${id}`" class="pl15 whiteBg  bb mb10">
					<view class=" ptb10 bt">
						<arrowNav>
							废液回收记录
						</arrowNav>
					</view>
				</navigator>
				
				
				<navigator hover-class="op9" :url="`/pages/comsumablesRepalce/comsumablesRepalceList?id=${id}&type=${type}`" class="pl15 whiteBg   ">
					<view class=" ptb10 bt">
						<arrowNav>
							易耗品更换记录
						</arrowNav>
					</view>
				</navigator>
				
				<navigator hover-class="op9" :url="`/pages/modifyRecord/modifyRecordList?id=${id}`" class="pl15 whiteBg   ">
					<view class=" ptb10 bt">
						<arrowNav>
							在线监测仪器参数设置记录
						</arrowNav>
					</view>
				</navigator>
			</block>
			
			
			
		</block> -->
		
		
	</view>
</template>

<script>
	export default {
		data() {
			return {
				isHide : false ,
				id : "" ,
				// type : 1 ,
				// count : 0 ,
				// times : 0 ,
				// showRechargePanel : false ,
				curIndex : 0
			}
		},
		
		onLoad(p) {
			this.id = p.id ;
		},
		
		onPullDownRefresh() {
			this.isHide = true ;
			this.$nextTick(()=>{
				this.isHide = false ;
			})
		},
		
		onHide() {
			this.isHide = true ;
		},
		
		onShow() {
			this.isHide = false ;
			// this.loadData();
			// this.refreshData();
		},
		
		methods: {
			
			loadData:function(e){
				this.$nextTick(()=>{
					if (this.type == 1 && this.curIndex == 0 ) {
						this.$refs.watersInfo.loadWaterInfo();
						return ;
					}
					if (this.type == 2 && this.curIndex == 0) {
						this.$refs.gasInfo.loadWaterInfo();
					}
				})
			},
			
			changeMenu:function(e){
				this.curIndex = e.index ;
			},
			
			success:function(e){
				this.showRechargePanel = false ;
				this.loadData();
			},
			
			refreshData(){
				if (this.curIndex == 0) {
					this.$refs.stationInfo.loadData();
				}else if (this.curIndex == 1) {
					this.$refs.runRecords.refreshing() ;
				}else if (this.curIndex == 2) {
					this.$refs.stopRecords.refreshing() ;
				}
			}
		}
	}
</script>

<style>

</style>
